package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.HRServicedtp;
import com.zr.serviceImpl.HRServiceImpldtp;

public class SaveControllerdtp extends HttpServlet{
	HRServicedtp hr=new HRServiceImpldtp();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		PrintWriter pw=resp.getWriter();
		String departement=req.getParameter("depart");
		String position=req.getParameter("posit");
		int eid=Integer.parseInt(req.getParameter("eid"));
		boolean flag=hr.changeJob(eid, departement, position);
		if(flag){
			pw.write("ture");
		}else{
			pw.write("false");
		}
	}
	
}
